﻿/*******************************************************************************************************************************************
Modification History:
********************************************************************************************************************************************
Date		Author		    Description
********************************************************************************************************************************************
05/07/2011	Brian Kuhn	    Created IDeferredExecute interface
*******************************************************************************************************************************************/
using System;

namespace Concise
{
    /// <summary>
    /// Describes an entity that can defer execution of an <see cref="Action"/> when 
    /// the type of the parameter passed to the delegate method is not known.
    /// </summary>
    /// <seealso cref="WeakAction{T}"/>
    public interface IDeferredExecute
    {
        //=======================================================================================================
        //	Methods
        //=======================================================================================================
        #region Execute(params object[] parameters)
        /// <summary>
        /// Executes the delegate method using the specified <paramref name="parameters"/>.
        /// </summary>
        /// <param name="parameters">The parameters passed to the <see cref="Action"/>.</param>
        /// <remarks>
        /// Implementors should cast the <paramref name="parameters"/> to the types expected by the <see cref="Action"/> 
        /// delegate, and if unable to cast the <paramref name="parameters"/>; pass the <see langword="default"/> of 
        /// the expected types.
        /// </remarks>
        void Execute(params object[] parameters);
        #endregion
    }
}
